<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>PokeMini Documentation</title>
<!-- InstanceEndEditable -->
<style type="text/css"> 
<!-- 
body  {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #E8E8E0;
	margin: 0;
	padding: 0;
	text-align: center;
	color: #000000;
}

#container { 
    overflow: auto;
    clear: both;
	width: 52em;
	background: #FFFFFF;
	margin: 0 auto;
	border: 1px solid #000000;
	text-align: left;
} 

#sidebar {
	float: left;
	width: 12em;
	background: #FFFFFF;
	padding: 16px 0px;
	font-size: 0.75em;
}

#sidebar h3, #sidebar p {
	margin-left: 10px;
	margin-right: 10px;
}

#mainContent {
 	margin: 0em 1.5em 0em 10em;
}

.clearfloat {
	clear: both;
    height: 0;
    font-size: 1px;
    line-height: 0px;
}

.printfooter {
	border: 1px solid #000000;
	background: #F0F0F0;
}

.smallfnt {font-size: 0.6em;}
.smallfnt pre {font-size: 1.2em;}
.copyright {font-size: 0.6em;}

a:link {color:#930;}
a:visited {color:#930;}
a:hover {color:#C63;}
a:active {color:#C99;}

.code_comm {color: #777;}
.code_def {color: #690;}
.code_cptr {color: #848;}
.code_cvar {color: #488;}
.code_dire {color: #069; font-weight:bold;}
.code_macro {color: #096; font-weight:bold;}
.code_func {color: #696; font-weight:bold;}
.code_opc {color: #663; font-weight:bold;}
.code_string {color: #930;}
--> 
</style>
<script type="text/javascript">
function InstructionSet_CheckItem()
{
	var icoEl = document.getElementById('InstructionSet_Ico');
	var divEl = document.getElementById('InstructionSet_Div');
	if (divEl.style.display == "none") {
		icoEl.alt = "-";
		icoEl.src = "ico_minus.gif";
		divEl.style.display = "inline";
	} else {
		icoEl.alt = "+";
		icoEl.src = "ico_plus.gif";
		divEl.style.display = "none";
	}
}
</script>
<!-- InstanceBeginEditable name="Collapse_InstructionSet" -->
<script type="text/javascript">
window.onload = InstructionSet_CheckItem;
</script>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head><body>

<div id="container">
  <div id="sidebar">
    <h3 style="text-align:center"><img src="logo.png" alt="Logo" width="41" height="55" /><br />PokeMini</h3>
    <p><a href="index.html">Overview</a></p>
    <p><a href="http://code.google.com/p/pokemini/">Website</a></p>
    <p><a href="history.html">History</a></p>
    <p><a href="keys_info.html">Keys and Info</a></p>
    <p><a href="commandline.html">Command-Line</a></p>
    <p><a href="about_links.html">About / Links</a></p>
    <h3 style="text-align:center">Libraries</h3>
    <p><a href="LIB_pm_init.html">pm_init</a></p>
    <p><a href="LIB_pm_music.html">pm_music</a></p>
    <h3 style="text-align:center">Tools</h3>
    <p><a href="TOOLS_colormapper.html">Color Mapper</a></p>
    <p><a href="TOOLS_ImgConv.html">Image Converter</a></p>
    <p><a href="TOOLS_MusicConv.html">Music Converter</a></p>
    <p>Last Updated:<br />
      <strong>Dec 18, 2013</strong></p>
    <br /><br />
    <h3 style="text-align:center"><img src="cpudie.gif" alt="CPU Die" width="73" height="55" /><br />
      Hardware</h3>
    <p><a href="Minx_Cpu.html">Minx CPU</a></p>
    <p><img src="ico_minus.gif" alt="-" name="InstructionSet_Ico" width="11" height="11" id="InstructionSet_Ico"  onclick="javascript:InstructionSet_CheckItem()" /> <a href="PM_InstructionList.html">Instruction Set:</a></p>
    <div id="InstructionSet_Div">
    	<ul>
    	  <li><a href="PM_Opc_NOP.html">NOP</a></li>
    	  <li><a href="PM_Opc_MOV8.html">MOV (8-Bits)</a></li>
    	  <li><a href="PM_Opc_MOV16.html">MOV (16-Bits)</a></li>
    	  <li><a href="PM_Opc_ADD8.html">ADD (8-Bits)</a></li>
    	  <li><a href="PM_Opc_ADD16.html">ADD (16-Bits)</a></li>
    	  <li><a href="PM_Opc_SUB8.html">SUB (8-Bits)</a></li>
    	  <li><a href="PM_Opc_SUB16.html">SUB (16-Bits)</a></li>
    	  <li><a href="PM_Opc_ADC8.html">ADC (8-Bits)</a></li>
    	  <li><a href="PM_Opc_ADC16.html">ADC (16-Bits)</a></li>
    	  <li><a href="PM_Opc_SBC8.html">SBC (8-Bits)</a></li>
    	  <li><a href="PM_Opc_SBC16.html">SBC (16-Bits)</a></li>
    	  <li><a href="PM_Opc_CMP8.html">CMP (8-Bits)</a></li>
    	  <li><a href="PM_Opc_CMP16.html">CMP (16-Bits)</a></li>
    	  <li><a href="PM_Opc_INC.html">INC</a></li>
    	  <li><a href="PM_Opc_DEC.html">DEC</a></li>
    	  <li><a href="PM_Opc_NEG.html">NEG</a></li>
    	  <li><a href="PM_Opc_MUL.html">MUL</a></li>
    	  <li><a href="PM_Opc_DIV.html">DIV</a></li>
    	  <li><a href="PM_Opc_TST.html">TST</a></li>
    	  <li><a href="PM_Opc_AND.html">AND</a></li>
    	  <li><a href="PM_Opc_OR.html">OR</a></li>
    	  <li><a href="PM_Opc_XOR.html">XOR</a></li>
    	  <li><a href="PM_Opc_NOT.html">NOT</a></li>
    	  <li><a href="PM_Opc_SHL.html">SHL</a></li>
    	  <li><a href="PM_Opc_SAL.html">SAL</a></li>
    	  <li><a href="PM_Opc_SHR.html">SHR</a></li>
    	  <li><a href="PM_Opc_SAR.html">SAR</a></li>
    	  <li><a href="PM_Opc_ROL.html">ROL</a></li>
    	  <li><a href="PM_Opc_ROLC.html">ROLC</a></li>
    	  <li><a href="PM_Opc_ROR.html">ROR</a></li>
    	  <li><a href="PM_Opc_RORC.html">RORC</a></li>
    	  <li><a href="PM_Opc_XCHG.html">XCHG</a></li>
    	  <li><a href="PM_Opc_PACK.html">PACK</a></li>
    	  <li><a href="PM_Opc_UNPACK.html">UNPACK</a></li>
    	  <li><a href="PM_Opc_SWAP.html">SWAP</a></li>
    	  <li><a href="PM_Opc_EX.html">EX</a></li>
    	  <li><a href="PM_Opc_PUSH.html">PUSH</a></li>
    	  <li><a href="PM_Opc_POP.html">POP</a></li>
    	  <li><a href="PM_Opc_CALL.html">CALL</a></li>
    	  <li><a href="PM_Opc_JMP.html">JMP</a></li>
    	  <li><a href="PM_Opc_RET.html">RET</a></li>
    	  <li><a href="PM_Opc_HALT.html">HALT</a></li>
    	  <li><a href="PM_Opc_STOP.html">STOP</a></li>
  	  </ul>
   	</div>
    <p><a href="PM_Memory.html">Memory Map</a></p>
    <p><a href="PM_Cartridge.html">Cartridge </a></p>
    <p><a href="PM_RAM.html">RAM</a></p>
    <p><a href="PM_IRQBios.html">Interrupt / BIOS</a></p>
    <p><a href="PM_Registers.html">Hardware Registers</a></p>
    <p><a href="PM_Timers.html">Timers</a></p>
    <p><a href="PM_IO_Port.html">Hardware I/O Port</a></p>
    <p><a href="PM_Audio.html">Audio / Sound</a></p>
    <p><a href="PM_PRC.html">PRC (Program Rendering Chip)</a></p>
    <p><a href="LCD_Controller.html">LCD Controller</a></p>
    <p><a href="PM_Pinouts.html">Cartridge Pinsout</a></p>
    <p>Last Updated:<br />
      <strong>Dec. 16, 2011</strong></p>
  </div>
  <div id="mainContent">
  <!-- InstanceBeginEditable name="Content" -->
    <h1>LCD Controller </h1>
    <h2><span class="mw-headline" id="LCD_Controller_Overview">Overview </span></h2>
    <p>The Pokemon Mini LCD is a serial display with it's own on-board 
      framebuffer, and display settings. These are all abstracted by the <a href="PM_PRC.html" title="PM PRC">PRC</a>,
      which handles display copies ($1000 ~ $12FF) and other various 
      functions. No commercial roms directly access the display, relying on 
      the PRC and BIOS to perform the various communications. This allows for 
      the PM to have hardware changes without having to rely on the same 
      display controller. </p>
    <p>The display is driven by two data ports, $20FE and $20FF. Both 
      ports are read\write, the only difference between them is one sets the 
      CTRL line when accessing the data port on the LCD. The port is 8-bits 
      wide, and has a small set of standard commands. </p>
    <p>The LCD is probably using the on-glass <s><a href="http://www.solomon-systech.com/products/ssd1828.htm" class="external text" rel="nofollow">SSD1828 LCD controller</a> or something very simliar.</s><a href="http://www.bolymin.com.tw/Doc/SED1565.pdf" class="external text" rel="nofollow">SED1565 LCD Controller</a> </p>
    <p>The controller got <s>96x65</s> 132x65 Graphic Display Data RAM 
      (GDDRAM) with 96x64 pixels visible on the LCD. The additional RAM is for
      an unused symbol driver. The PM most likely uses a parallel interface 
      to the controller, but serial interface might be available on the 
      connector of the LCD. </p>
    <h2>LCD Controller Commands</h2>
    <p>Lower case &quot;x&quot; denotes parameters used by the command. A question mark &quot;?&quot; denotes bits that are don't care. </p>
    <p>The commands in this list are verified to work. The <s>SSD1828</s> datasheet holds <s>much</s> more commands <s>that are hard</s>of which a few are hard to verify <s>or didn't work</s> on the PM. </p>
    <table border="1" class="smallfnt">
      <caption>
      <b>LCD Commands</b>
      </caption>
      <tbody>
        <tr>
          <th> Command </th>
          <th> Description </th>
          <th> Notes </th>
        </tr>
        <tr>
          <td> 0000 xxxx </td>
          <td> Set Column (low nibble) </td>
          <td> xxxx = Column 0-15 (low nibble) </td>
        </tr>
        <tr>
          <td> 0001 0xxx </td>
          <td> Set Column (high nibble) </td>
          <td> xxxx = Column 0-8 (high nibble) </td>
        </tr>
        <tr>
          <td> 01xx xxxx </td>
          <td> Display Start line </td>
          <td> xxxxxx = 0-63 first line on display </td>
        </tr>
        <tr>
          <td> 1011 xxxx </td>
          <td> Set Page </td>
          <td> xxxx = Page (0-8, pages 0-7 are 8px high, Page 8 = 1px high) </td>
        </tr>
        <tr>
          <td> 1000 0001 </td>
          <td> Set Contrast </td>
          <td> Next write to FE or FF sets Constrast Level ($00-$3F) </td>
        </tr>
        <tr>
          <td> 1010 000x </td>
          <td> Segment Driver Direction Select </td>
          <td> x=0 (Normal) 1 (Reverse) Note on Reverse 131 is the leftmost 
            pixel and 36 the rightmost visible pixel. Pixels 35-0 are not visible. 
            This command only affects the addressing arithmetics on the next 
            read/writes and does not change any data that is already displayed. </td>
        </tr>
        <tr>
          <td> 1010 001x </td>
          <td> LCD Voltage Bias </td>
          <td> x=0 (1/9th = normal) 1 (1/7th = darker ) </td>
        </tr>
        <tr>
          <td> 1010 010x </td>
          <td> Entire Display select </td>
          <td> x = 0 (normal) or 1 (all Pixels on) </td>
        </tr>
        <tr>
          <td> 1010 011x </td>
          <td> Invert Display select </td>
          <td> x = 0 (normal) or 1 (invert) effective immediately. Ram is not affected. </td>
        </tr>
        <tr>
          <td> 1010 111x </td>
          <td> Display ON/OFF </td>
          <td> x = 0 (off) or 1 (on) </td>
        </tr>
        <tr>
          <td> 1100 x??? </td>
          <td> Set scan direction (rows) </td>
          <td> x = 0 (normal from row 0 to 63) or 1 (from row 63 to 0 - verical mirror) </td>
        </tr>
        <tr>
          <td> 1110 0000 </td>
          <td> Read Modify Write </td>
          <td> A read to display ram wil not advance the ram pointer. Only a 
            write will advance the ram pointer. When active, column commands are not
            available. </td>
        </tr>
        <tr>
          <td> 1110 1110 </td>
          <td> End </td>
          <td> Ends Read Modify Write mode. </td>
        </tr>
        <tr>
          <td> 1110 0010 </td>
          <td> Reset </td>
          <td> Initializes Display. </td>
        </tr>
        <tr>
          <td> 1110 0011 </td>
          <td> NOP </td>
          <td> No Operation. Also used to exit test mode. </td>
        </tr>
      </tbody>
    </table>
    <h2>Data reads/writes</h2>
    <p>Data can be read and written from/to the LCD at any time (but not when contrast command was executed, this is a special case).
      The programmer should make sure that the page and column address pointers are pointing to the correct location. </p>
    <p>When data was read or written the column address automatically increases by one. </p>
    <p>After executing page address and both of the column address set operations data can be written to the selected location. </p>
    <div class="printfooter"> Retrieved from &quot;<a href="http://wiki.sublab.net/index.php/LCD_Controller">http://wiki.sublab.net/index.php/LCD_Controller</a>&quot;</div>
    <!-- InstanceEndEditable -->
    <span class="clearfloat"></span>
  </div>
</div>
<p class="copyright">&copy; 2011-2013 by JustBurn - Hardware documentation copy from Sublab by Team-Pokémé</p>
</body>
<!-- InstanceEnd --></html>
